
  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   15.1   Copyright 1985-2017 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     MP - Parallel Edition            College Station, Texas 77845 USA
                                      800-STATA-PC        http://www.stata.com
                                      979-696-4600        stata@stata.com
                                      979-696-4601 (fax)

32-user 64-core Stata network perpetual license:
       Serial number:  501506200495
         Licensed to:  Harvard-MIT Data Center
                       Cambridge, MA

Notes:
      1.  Stata is running in batch mode.
      2.  Unicode is supported; see help unicode_advice.
      3.  More than 2 billion observations are allowed; see help obs_advice.
      4.  Maximum number of variables is set to 5000; see help set_maxvar.

. do "dofiles/8_Table_A4.do" 

. /*
> Replication files for "Housing Discrimination and the Pollution Exposure Gap 
> in the United States" 
> */
. 
. 
. clear all

. set matsize 11000

. 
. use "../stores/toxic_discrimination_data.dta"

. 
. 
. keep if sample==1
(801 observations deleted)

. 
. set seed 1010101

. 
. *****************************************************************************
> *******************
. * Overall Discrimination Rates
. *****************************************************************************
> *******************
. 
. 
. *****************************************************************************
> *******************
. * Minority
. *****************************************************************************
> *******************
. 
. 
. 
. eststo: disc_boot choice Minority , varlist(i.gender i.education_level i.orde
> r)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -929.63689  
Iteration 1:   log pseudolikelihood = -922.15907  
Iteration 2:   log pseudolikelihood =  -922.1401  
Iteration 3:   log pseudolikelihood =  -922.1401  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                Wald chi2(6)      =      64.07
                                                Prob > chi2       =     0.0000
Log pseudolikelihood =  -922.1401               Pseudo R2         =     0.0776

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
    Minority |  -.2649237   .1039817    -2.55   0.011    -.4359584   -.0938889
             |
      gender |
       male  |  -.3182584   .0920774    -3.46   0.001    -.4697122   -.1668046
             |
education_~l |
        low  |  -.1826632   .1166567    -1.57   0.117    -.3745464    .0092201
     medium  |  -.2944602   .1374571    -2.14   0.032     -.520557   -.0683634
             |
       order |
          2  |  -.3407344   .2391886    -1.42   0.154    -.7341647    .0526959
          3  |  -.9075538   .2012317    -4.51   0.000     -1.23855   -.5765571
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
    Minority |  -.2649237   .1035797    -2.56   0.024    -.4483565   -.0814908
------------------------------------------------------------------------------
(est1 stored)

. sum choice if White==1 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      2,241    .3944668    .4888449          0          1

. estadd scalar responsewhite = r(mean), replace 

added scalar:
      e(responsewhite) =  .39446676

. estadd local gender = "Yes", replace 

added macro:
             e(gender) : "Yes"

. estadd local edu = "Yes", replace 

added macro:
                e(edu) : "Yes"

. estadd local order = "Yes", replace 

added macro:
              e(order) : "Yes"

. estimates store model1

. 
. 
. *****************************************************************************
> *******************
. * African American vs Hispanic/LatinX
. *****************************************************************************
> *******************
. eststo: disc_boot choice Black  Hispanic , varlist(i.gender i.education_level
>  i.order)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -914.78491  
Iteration 1:   log pseudolikelihood = -906.23244  
Iteration 2:   log pseudolikelihood = -906.18225  
Iteration 3:   log pseudolikelihood = -906.18225  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                Wald chi2(7)      =      96.99
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -906.18225               Pseudo R2         =     0.0936

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
       Black |  -.5081979   .1490413    -3.41   0.001    -.7533491   -.2630467
    Hispanic |  -.0254966    .082486    -0.31   0.757     -.161174    .1101808
             |
      gender |
       male  |  -.3110853   .0949621    -3.28   0.001     -.467284   -.1548866
             |
education_~l |
        low  |  -.2214558     .12625    -1.75   0.079    -.4291186    -.013793
     medium  |   -.314873   .1305671    -2.41   0.016    -.5296367   -.1001092
             |
       order |
          2  |  -.3349886   .2475559    -1.35   0.176    -.7421818    .0722045
          3  |  -.9119584   .2099533    -4.34   0.000    -1.257301    -.566616
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
       Black |  -.5081979   .1506538    -3.37   0.005    -.7749958      -.2414
    Hispanic |  -.0254966    .082533    -0.31   0.762     -.171657    .1206638
------------------------------------------------------------------------------
(est2 stored)

. sum choice if White==1 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      2,241    .3944668    .4888449          0          1

. estadd scalar responsewhite = r(mean), replace 

added scalar:
      e(responsewhite) =  .39446676

. estadd local gender = "Yes", replace 

added macro:
             e(gender) : "Yes"

. estadd local edu = "Yes", replace 

added macro:
                e(edu) : "Yes"

. estadd local order = "Yes", replace 

added macro:
              e(order) : "Yes"

. estimates store model2

. 
. 
. *****************************************************************************
> *******************
. * Export to latex
. * based on http://www.eyalfrank.com/code-riffs-stata-and-regression-tables/
. *****************************************************************************
> ******************
. 
. 
. #delimit ; 
delimiter now ;
. esttab model1
>           model2
>        using "../views/tableA4.tex",  
>        style(tex) 
>        eform
>        cells(b(star fmt(4)) ci(par fmt(4) par(( , )))  ) 
>        label 
>        stats(responsewhite
>              gender 
>              edu 
>              order
>              N
>              listings
>              diff_response, fmt(2 0 0 0 %9.0gc %9.0gc 2)
>              labels(" Mean Response (White)"
>                    "\hline Gender" 
>                    "Education Level" 
>                    "Inquiry Order"
>                    "\hline Observations"
>                    "Listings"
>                    "\% w. diff. response"
>                    )) 
>        mlabels( ,none)  
>        nonumbers
>        collabels(,none) 
>        eqlabels(,none)
>        varlabels(Minority  "Minority"
>                                 Black  "African American"
>                                 Hispanic "Hispanic/LatinX")
>        starl(* 0.1 ** 0.05 *** 0.01)   
>        level(90) 
>        prehead( 
> 
> \begin{table}[H]
> \footnotesize \centering
> \begin{threeparttable}
> \captionsetup{justification=centering}
>   \caption{Overall Discrimination Rates }
>   \label{tab:probhighexposure}
> 
> \begin{tabular}{@{\extracolsep{5pt}} lcc} 
> \\[-1.8ex]\hline 
> \hline \\[-1.8ex] 
> & \multicolumn{2}{c}{\it Dependent variable:} \\
> & \multicolumn{2}{c}{\it  Response} \\
> \cline{2-3}\\ [-1.8ex]
> 
> &(1)              & (2)                   \\
>        )
>        posthead(\hline) 
>        prefoot() 
>        postfoot(
> 
> 
> \\[-1.8ex]\hline 
> \hline \\[-1.8ex] 
> \end{tabular} 
> 
> \begin{tablenotes}[scriptsize,flushleft] \scriptsize
> \item Notes: 
> \end{tablenotes}
> \end{threeparttable}
> \end{table}
> )
>        replace;
(output written to ../views/tableA4.tex)

. #delimit cr
delimiter now cr
. 
end of do-file
